#include <stdio.h>
#include <memory.h>

int main( )
{
    int n, s[ 101 ], i;
    while ( scanf("%d", &n) != EOF && n )
    {
        memset( s, 0, sizeof( s ) );
        while ( n-- )
        {
            scanf("%d", &i);
            s[ i ]++;
        }
        scanf("%d", &i);
        printf("%d\n", s[ i ]);
    }
    return 0;
}
